package com.example.tests;

import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import java.util.logging.Logger;
import org.testng.annotations.Test;
import com.example.fw.GroupObject;
import com.example.fw.Groups;

public class GroupCreationTestsValidData extends TestBase {
	
	private  Logger log = Logger.getLogger("GroupCreationTests");
	
	@Test (dataProvider = "groupsFromFile", dataProviderClass = GroupDataGenerator.class)
	public void testValidGroupCanBeCreated(GroupObject validGroup) throws Exception {
		Groups oldList = app.getGroupHelper().getGroups();
		app.getGroupHelper().createGroup(validGroup);
		Groups newList = app.getGroupHelper().getGroups();
		assertThat(newList, equalTo(oldList.withAdded(validGroup)));
	}
}